package com.gaara.test;

import android.graphics.Canvas;
import android.graphics.Paint;

public abstract class Scene implements IScene {

	public Paint paint;
	public MyView view;
	
	public Boolean init = false;
	
	public Scene(MyView view) {
		this.view = view;
		paint = new Paint();
		paint.setAntiAlias(true);
	}

	@Override
	public  void update(Canvas canvas) {
		if(init == false){
			init = true;
			onLoadResource();
			return;
		}
		
		onDraw(canvas);
	}
	
	/** 绘制 **/
	public abstract void onDraw(Canvas canvas);
	
	/** 第一次加载资源 **/
	public void onLoadResource(){
		
	}

	/** 是否加载完成 **/
	public boolean isInit() {
		return init;
	}

	@Override
	public void release() {
		// TODO Auto-generated method stub
		
	}
	
	
	
}
